<?php
/**
 * 关于我们
 */
namespace app\index\controller;

use think\Controller;
use think\Request;

class Contactus extends Common
{   
    public function _initialize(){
        parent::_initialize();
        $works=$this->getchild(20);//作品
        $about=$this->getchild(16);//关于我们
        $this->assign([
            'works' =>$works,
            'child' =>$about,
        ]);
    }
    /**
     * 显示资源列表
     *
     * @return \think\Response
     */
    public function index($id)
    {
        $page=db('category')->where('id',$id)->find();
        
        if (!$page) {
            abort(404, '访问的页面不存在');
        }
        $pos=$this->getPos($id);
        $this->assign(array(
            'page'  =>$page,
            'currid'=>$id,//当前栏目id
            'pos'   =>$pos,
        ));
        return view('page/index');
    }

}
